# -*- coding: utf-8 -*-

import numpy as np


def np_file_npy():
    file_name = 'a.npy'
    np.save(file_name, np.arange(10))
    file_data = np.load(file_name)
    print(file_data)
    pass


def np_file_npz():
    a10 = np.arange(10)
    a20 = np.arange(20)

    file_name = 'a.npz'
    np.savez(file_name, a1=a10, a2=a20)
    file_data = np.load(file_name)
    print(type(file_data))
    print(file_data)
    print(file_data['a1'])
    print(file_data['a2'])

    pass


if __name__ == '__main__':
    # np_file_npy()
    np_file_npz()
    pass
